#include "sensor.h"

/*
 * 功能: 初始化Webots位置传感器
 * 参数:
 *   sensor_name - 传感器名称，必须与Webots中的传感器节点名称一致
 *   time_step - 传感器采样时间步长
 * 返回: 传感器句柄
 */
WbDeviceTag Sensor_Init(const char *sensor_name, int time_step)
{
    WbDeviceTag sensor_handle;
    sensor_handle = wb_robot_get_device(sensor_name);
    wb_position_sensor_enable(sensor_handle, time_step);
    return sensor_handle;
}
